#ifndef _CE_TIMER_H_
#define _CE_TIMER_H_

#include "../CEGlobalDef.h"
#include "cocos2d.h"

#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32) 
#include <time.h>
#endif

class CETimer
{
private:
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) 
	LARGE_INTEGER	m_nFrequency;
	LARGE_INTEGER	m_nTimeStart;
	LARGE_INTEGER	m_nTimeStop;
#else
	timespec m_nTimeStart;
	timespec m_nTimeStop;
#endif
	int				m_nFPS;

public:
	CETimer();
	void			Start();
	void			Stop();
	unsigned int	GetElapse();
	unsigned int	GetElapseFrequency();
	unsigned int	GetInterval();
	bool			Passed(int nTime);
	bool			GetFPS(int* nFPS);
};

#endif
